package com.luo.ai.assistant.chat.tool.function;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.function.Consumer;

/**
 * 工具 - 根据指定时间设置报警
 */
public class SetAlarm implements Consumer<SetAlarmRequest> {
    private Logger log = LoggerFactory.getLogger(SetAlarm.class);
    /**
     * 工具名称
     */
    public static final String TOOL_NAME = "setAlarm";

    @Override
    public void accept(SetAlarmRequest setAlarmRequest) {
        String time = setAlarmRequest.time();
        LocalDateTime alarmTime = LocalDateTime.parse(time, DateTimeFormatter.ISO_DATE_TIME);
        log.debug("[Tool] Alarm set for {}", alarmTime);
    }
}